package com.zzw.hj29;

import java.util.Scanner;

/**
 * @Project: hw_java
 * @Description: 字符串加解密
 * @Author: zzw
 */
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str1 = in.nextLine();
        String str2 = in.nextLine();
        System.out.println(encryptStr(str1));
        System.out.println(decryptStr(str2));
    }

    public static String encryptStr(String str) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i) >= 'A' && str.charAt(i) < 'Z') {
                char c = (char) (str.charAt(i) + 1 + 32);
                sb.append(c);
            } else if (str.charAt(i) == 'Z') {
                sb.append('a');
            } else if (str.charAt(i) >= 'a' && str.charAt(i) < 'z') {
                char c = (char) (str.charAt(i) + 1 - 32);
                sb.append(c);
            } else if (str.charAt(i) == 'z') {
                sb.append('A');
            } else if (str.charAt(i) >= '0' && str.charAt(i) < '9') {
                char c = (char) (str.charAt(i) + 1);
                sb.append(c);
            } else if (str.charAt(i) == '9') {
                sb.append('0');
            } else {
                continue;
            }
        }
        return sb.toString();
    }

    public static String decryptStr(String str) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i) > 'A' && str.charAt(i) <= 'Z') {
                char c = (char) (str.charAt(i) - 1 + 32);
                sb.append(c);
            } else if (str.charAt(i) == 'A') {
                sb.append('z');
            } else if (str.charAt(i) > 'a' && str.charAt(i) <= 'z') {
                char c = (char) (str.charAt(i) - 1 - 32);
                sb.append(c);
            } else if (str.charAt(i) == 'a') {
                sb.append('Z');
            } else if (str.charAt(i) > '0' && str.charAt(i) <= '9') {
                char c = (char) (str.charAt(i) - 1);
                sb.append(c);
            } else if (str.charAt(i) == '0') {
                sb.append('9');
            } else {
                continue;
            }
        }
        return sb.toString();
    }
}